package cn.yeyiu.sexyiu.entity

import java.util.*
import javax.persistence.Entity
import javax.persistence.Id
import javax.persistence.Table

@Entity
@Table(name = "videos")
class JableVideo {
    @Id
    var id: String? = null
    var code: String? = null
    var title: String? = null
    var types: String? = null
    var tags: String? = null
    var logo: String? = null
    var preview: String? = null
    var src: String? = null
    var time: String? = null
    var info: String? = null
    fun getTypes(): List<String> {
        val nokh = types!!.substring(1, types!!.length - 1)
        return Arrays.asList(*nokh.split(",").toTypedArray())
    }

    fun getTags(): List<String> {
        val nokh = tags!!.substring(1, tags!!.length - 1)
        return Arrays.asList(*nokh.split(",").toTypedArray())
    }
}